package com.fzy.servlet;


import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

@WebServlet(name = "RegServlet", value = "/RegServlet")
public class RegServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String username = request.getParameter("username");
        String password = request.getParameter("password");

        // 模拟注册逻辑，这里简单认为注册成功
        boolean isRegistered = true;

        if (isRegistered) {
            request.getRequestDispatcher("suc.html").forward(request, response);
        } else {
            request.getRequestDispatcher("fal.html").forward(request, response);
        }
    }



}